/**
 * TCSS 360 System Q&A
 * Winter Qtr 2013
 * 
 * darksideoftheloom:
 * Michael Wamsley
 * Roger Trottier
 * Shane Kwon
 * Joshua Warner
 */
package darksideoftheloom;

import java.util.ArrayList;

/**
 * Represents the Judge class.
 * 
 * @author Michael
 * @version 2-18-2013
 */
public class Judge extends Attendee {
	
	/**
	 * The category in which the judge is judging.
	 * Judges cannot submit in their own category.
	 */
	private String category;
	

	/**
	 * Constructs a new Judge object.
	 * 
	 * @param a_name
	 * @param a_phoneNumber
	 * @param a_address
	 * @param a_email
	 * @param a_username
	 * @param a_password
	 */
	public Judge(final String a_name, final String a_phoneNumber, final String a_address,
			final String a_email, final String a_username, final String a_password, 
			final String a_category) {
		super(a_name, a_phoneNumber, a_address, a_email, a_username, a_password);
		category = a_category;
	}
	
	/**
	 * Allows a judge to submit a submission.
	 * Judges cannot submit to their own category.
	 */
	public void submit(final Submission a_submission) {
		if (a_submission.getCategory() == category) {
			throw new IllegalArgumentException("You cannot submit to the " +
					"same category that you are judging!");
		} else {
			super.submit(a_submission);
		}
	}
	
	/**
	 * Allows you to set or change the judge's current category.
	 */
	public void setCategory(final String a_category) {
		category = a_category;
	}
	
	/**
	 * Returns the judges current category.
	 * @return category
	 */
	public String getCategory() {
		return category;
	}
	
}
